var highLod : Mesh;
var lowLod : Mesh;
var distance = 10.0;

function Update ()
{
    var campos = Camera.main.transform.position;
    var meshFilter : MeshFilter = GetComponent(MeshFilter);
    if( (transform.position - campos).sqrMagnitude <
        distance * distance )
    {
        // use high LOD
        if( meshFilter.sharedMesh != highLod )
            meshFilter.sharedMesh = highLod;
    }
    else
    {
        // use low LOD
        if( meshFilter.sharedMesh != lowLod )
            meshFilter.sharedMesh = lowLod;
    }
} 